function [ x ] = AR_Gen( a,delta,N )
%AR_Gen Summary of this function goes here
%   Detailed explanation goes here
x = zeros(N,1);
vn = wgn(N,1,delta);
x(1) = vn(1);
x(2) = -a(1)*x(1) + vn(2);
x(3) = -a(1)*x(2) - a(2)*x(1) + vn(3);
x(4) = -a(1)*x(3) - a(2)*x(2) - a(3)*x(1) + vn(4);
for n = 5:N
    x(n) = vn(n);
    for k = 1:4
        x(n) = x(n) - a(k)*x(n-k);
    end
end
end

